<?php
namespace app\wap\model;

use think\Model;

class OrderContract extends Model
{
    /**
     * 查询会员认投项目列表
     * @param $where
     * @author hey_heyang(635870453@qq.com)
     * @return array
     */
    public function getMemberContractList($where){
//        $where['p.status'] =['egt',3]; // 项目状态认投已成功
        $where['oc.sign']  = 3;
        $where['oc.status']  = 1;
        $field = "p.project_name,p.picture,oc.id,FROM_UNIXTIME(oc.create_time) as time,oc.title,oc.money,c.logo";
        $data = $this
            ->alias('oc')
            ->join('tf_project p', 'p.id=oc.project_id')
            ->join('tf_contract c','c.id=oc.cid')
            ->field($field)
            ->where($where)
            ->order('time DESC')
            ->select();
        $list = empty($data)?array():$data->toArray();
        return $list;
    }


}